#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

icon = $(CURDIR)/runescape.png
script = $(CURDIR)/runescape
launcher = $(CURDIR)/runescape.desktop

DEST1 = $(CURDIR)/debian/runescape/usr/local/games
DEST2 = $(CURDIR)/debian/runescape/usr/local/games/runescape
DEST3 = $(CURDIR)/debian/runescape/usr/share/applications
DEST4 = $(CURDIR)/debian/runescape/usr/share/pixmaps
DEST5 = $(CURDIR)/debian/runescape/usr/bin

build: build-stamp
build-stamp:
	dh_testdir
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean

install: build clean $(icon) $(script) $(launcher)
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	dh_install

	mkdir -m 777 -p $(DEST1)
	mkdir -m 777 -p $(DEST2)
	mkdir -m 755 -p $(DEST3)
	mkdir -m 755 -p $(DEST4)
	mkdir -m 777 -p $(DEST5)

	cp -r bin $(CURDIR)/debian/runescape/usr/local/games/runescape
	cp -r images $(CURDIR)/debian/runescape/usr/local/games/runescape
	
	install -m 755 $(icon) $(DEST4)
	install -m 777 $(script) $(DEST5)
	install -m 755 $(launcher) $(DEST3)

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installman
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
